REALbasic XML Format

REALbasic 3 supports exporting a project file in XML format. XML is a structured text format in which all the information is marked up with semantic tags.

For a brief orientation to XML documents in general, see What Do XML Documents Look Like?. The XML produced by REALbasic is well-formed, but it is not "valid" (i.e. validatable) because it does not include a "document type declaration". Most of the content should be self-explanatory, with the aid of the reference below. Whitespace is significant only in the content area of the innermost tags; whitespace between one tag and a different one is not significant.

The general structure of a REALbasic XML file is:

<RBProject Version="3.0"><block type="SomeBlockType" ID="1234">  <SomeTag>Content goes here</SomeTag>  <AnotherTag>More content</AnotherTag></block><block type="AnotherBlockType" ID="5678">  <SomeOtherTag>More content here</SomeOtherTag></block></RBProject>

The file is divided into "blocks" which are major organizational units. In general, there is one block for the project data (build settigs, etc.), followed by one block for each item in the Project window (see block types). Each block has an "ID" which is used to refer to the block (e.g., in the ObjContainerID tag). Some tags identify groups and may contain other tags.

Markup Tags

The markup tags used by REALbasic XML are (in alphabetical order):

      
BindDestBindData   bind destination binding data
BindDestData   bind destination data
Binding   an object binding
BindSource   bind source
BindSourceBindData   bind source binding data
BindSourceData   bind source data
BuildFlags   build flags: indicate target(s) and compression
BuildMacName   name for Mac built apps
BuildMinSize   minimum memory allocation for Mac built apps
BuildSize   memory allocation for Mac built apps
BuildWinMDI   Win32 MDI option
BuildWinName   name for Win32 built apps
ColorPalette   color palette
Constant   constant
ConstantInstance   constant value for a particular platform/language
Control   control
ControlBehavior   control behavior (event handlers etc.)
ControlIndex   control array index
CurrentLanguage   current language (for builds)
DefaultLanguage   default language
DefaultViewID   ID number of the default view
EditBounds   position of an editing window
EditSplit   position of a vertical splitter
Element   element of a larger grouping
EndSelCol   ending column of a selection
EndSelRow   ending row of a selection
FileAlias   alias to a file
FileType   file type
FormDefn   form (layout) definition
FullPath   full path to a file
Hook   event handler
HookInstance   event handler instance (with code)
Icon   icon data
InfoVersion   package info string
Interfaces   object's interface(s)
IsClass   indicates whether the item is a class
IsInterface   indicates whether the item is an interface
ItemData   item data
ItemDeclaration   item declaration
ItemDef   item definition
ItemDescription   item description
ItemDisabledHelp   item disabled balloon help
ItemFlags   item flags (meaning depends on context)
ItemFragName   CFM fragment name
ItemHelp   item balloon help
ItemIndex   item index (number within a list)
ItemLanguage   item language
ItemName   item name (used for smaller entities than ObjName)
ItemParams   item parameters
ItemPlatform   item platform
ItemResult   item result
ItemShortcut   menu item shortcut
ItemSource   item source
ItemSpecialMenu   indicates a special (built-in) menu
ItemStyle   item style
ItemText   item text
ItemTransparent   indicates the item is transparent
ItemType   item type
ItemVersion   item version
LastPositionH   last horizontal position
LastPositionV   last vertical position
LongVersion   long version string
MacCreator   Mac creator code
MajorVersion   major version number
MenuHandler   menu handler
MenuItem   menu item
Method   method
MinorVersion   minor version number
NonRelease   non-release number
ObjContainerID   ID number of the folder which contains this project item
ObjName   object name
ObjSize   object size in bytes
PartialPath   relative path to a file
Property   property declaration (as in the code editor)
PropertyVal   property value (as seen in the Properties window)
PropertyValue   property value (not used)
Region   region code
Release   Development, Alpha, Beta, Final
ShortVersion   short version string
SourceLine   line of source code
StartSelCol   starting column of a selection
StartSelRow   starting row of a selection
SubVersion   maintenance release number
Superclass   object's superclass
Target   target (reserved for future use)
WinMDICaption   Win32 MDI caption

Block Types

The possible values for the "type" attribute of the block tag are:

      
CFMPlugin   CFM Plugin
Cursor   mouse cursor image
Database   database
Folder   folder
Menu   menu definition
Module   class or module
Movie   QuickTime media
Picture   picture
Project   project info
ProjectItem   unknown project item
Resources   resources file
Script   AppleScript
Sound   sound file
Window   window definition
XCMDPlugin   XCMD plugin

Tag Content

String data within a tag must be marked up according to standard XML rules. Every "<" is replaced with "&lt;", each ">" is replaced with "&gt;", and every ampersand is replaced with "&amp;". In addition, high and low ASCII characters are represented in decimal form; for example, ASCII 614 would be represented as "&#614;". Finally, if a string contains ASCII values less than 32, it is represented with a special "<Hex>" tag, e.g.:

<Hex bytes="4">00C4A50B</Hex>

Example

Below is an abbreviated example of the XML import of a project containing a window, a menu, and a global module. The window contains a PushButton with code in its action event. The module contains a constant, a property, and one method.

Below is an abbreviated example of the XML import of a project containing a window, a menu, and a global module. The window contains a PushButton with code in its action event. The module contains a constant, a property, and one method.

<?xml version="1.0"?>(XML preamble)
<RBProject Version="3.0">(version of RB used)
<block type="Project" ID="0">(project-wide settings)
  <MajorVersion>1</MajorVersion>  <MinorVersion>0</MinorVersion>  	...
</block><block type="Window" ID="-1236533132">(here's the Window...)
  <ObjName>Window1</ObjName>  <ObjContainerID>0</ObjContainerID>  <EditBounds><Rect left="100" top="80" width="534"
height="390"/></EditBounds>	...
  <PropertyVal Name="Name">Window1</PropertyVal>  <PropertyVal Name="Frame">0</PropertyVal>  <PropertyVal Name="HasBackColor">False</PropertyVal>	...
  <FormDefn>   <ObjName>Window1</ObjName>   <ObjSize>120</ObjSize>   <Superclass>Applet</Superclass>   <IsInterface>0</IsInterface>  </FormDefn>  <ControlBehavior>   <ObjName></ObjName>   <ObjSize>116</ObjSize>   <Superclass>PushButton</Superclass>   <IsInterface>0</IsInterface>   <HookInstance>    <ItemName>Action</ItemName>    <ItemSource>     <StartSelRow>1</StartSelRow>     <StartSelCol>10</StartSelCol>     <EndSelRow>1</EndSelRow>     <EndSelCol>10</EndSelCol>     <SourceLine>Sub Action()</SourceLine>     <SourceLine>self.Close</SourceLine>     <SourceLine>End Sub</SourceLine>    </ItemSource>   </HookInstance>  </ControlBehavior>  <Control>   <ItemName>PushButton</ItemName>   <PropertyVal Name="Name">PushButton1</PropertyVal>	...
   <PropertyVal Name="Caption">OK</PropertyVal>   <PropertyVal Name="Default">True</PropertyVal>   <PropertyVal Name="Cancel">False</PropertyVal>   <PropertyVal Name="Enabled">True</PropertyVal>   <ControlIndex>0</ControlIndex>  </Control></block><block type="Menu" ID="-1236533133">(here's the Menu...)
  <ObjName>Menu</ObjName>  <ObjContainerID>0</ObjContainerID>  <EditBounds><Rect left="100" top="100" width="300" height="200"/></EditBounds>  <MenuItem>	...
  </MenuItem>  	...
</block><block type="Module" ID="-1236533108">(here's the Module...)
  <ObjName>Module1</ObjName>  <ObjContainerID>0</ObjContainerID>  <IsClass>0</IsClass>  <EditBounds><Rect left="84" top="220" width="400" height="300"/></EditBounds>  <Interfaces></Interfaces>  <ObjName>Module1</ObjName>  <ObjSize>24</ObjSize>  <IsInterface>0</IsInterface>  <Property Flags="0">kEOL</Property>  <Method>   <ItemName>InitGlobals</ItemName>   <ItemParams></ItemParams>   <ItemResult></ItemResult>   <ItemFlags>0</ItemFlags>   <ItemSource>    <StartSelRow>4</StartSelRow>    <StartSelCol>0</StartSelCol>    <EndSelRow>4</EndSelRow>    <EndSelCol>0</EndSelCol>    <SourceLine>Sub InitGlobals()</SourceLine>    <SourceLine>// Set the line ending appropriate for the platform</SourceLine>    <SourceLine>#if TargetWin32 then</SourceLine>    <SourceLine>kEOL = chr(10)</SourceLine>    <SourceLine>#else</SourceLine>    <SourceLine>kEOL = chr(13)</SourceLine>    <SourceLine>#endif</SourceLine>    <SourceLine>End Sub</SourceLine>   </ItemSource>  </Method>  <Constant>   <ItemName>kPi</ItemName>   <ItemType>2</ItemType>   <ItemDef>3.14157</ItemDef>  </Constant></block></RBProject>


Last checked or updated:
Wed, Jan 24, 2001